<template>
	<view class="decision-content">
		<view class="message-sv mt10">
			<view v-for="(i, index) in typeList" :key="i.tableType" class="table-box">
				<view class="flex-vc">
					<i class="iconfont icon-a-zhanghuanquan1" style="color: #0085ff; font-size: 36rpx"></i>
					<text class="ml10 fs26 fw600">{{ i.name }}</text>
				</view>
				<view>
					<text style="color: #0085ff" class="fs24 fw600" @click="turnTo(i)">去填报＞</text>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	// import sjsbApi from '@/api/yjzh/sjsb.js'

	export default {
		name: '',
		components: {},
		data() {
			return {
				typeList: [
					{ name: '县级山洪灾害隐患排查表', tableType: 'county-flood-warn' },
					{ name: '在建水利工程安全度汛检查表', tableType: 'water-safe-table' }
					// { name: '防汛非工程措施检查表', tableType: 'fx-flood-table' }
				]
			}
		},
		computed: {},
		async mounted() {},
		methods: {
			initPage() {},
			async init() {
				let areaCodes = []
				let parentItem = []

				if (this.areaCode2 == 'all') {
					parentItem = this.findItemById(this.getDeptTreeData[0], this.areaCode)
				} else {
					parentItem = this.findItemById(this.getDeptTreeData[0], this.areaCode2)
				}

				areaCodes = this.getChildCode([parentItem])

				// areaCodes.push(this.areaCode)
				// if (this.areaCode) {
				// 	areaCodes.push(this.areaCode)
				// }
				// if (this.areaCode2 != '255' && this.areaCode2) {
				// 	areaCodes.push(this.areaCode2)
				// }
				const resp = await sjsbApi.solveEvent({
					areaCodes: areaCodes.filter((item) => !item.includes('all')),
					evTypeCode: this.form.evType != 'all' ? this.form.evType : undefined,
					evLevel: this.form.level != 'all' ? this.form.level : undefined,
					date: undefined
				})
				if (resp.code == 200) {
					this.dataList = resp.data
					setTimeout(() => {
						this.$nextTick(() => {
							if (!this.initcollapse) {
								this.$refs.collapse && this.$refs.collapse.init()
								this.initcollapse = true
							}
						})
					}, 1000)
				}
			},

			turnTo(item) {
				uni.navigateTo({
					url: '/pages-subPackages/security/writeReport?data=' + encodeURIComponent(JSON.stringify(item)),
					fail: (err) => {}
				})

				// uni.$emit('eventsMap', this.dataList)
			}
		}
	}
</script>
<style lang="less" scoped>
	.decision-content {
		width: 100%;
		height: 100%;
		padding: 24rpx;

		.message-sv {
			width: 100%;
			height: calc(100% - 90rpx);
			font-size: 26rpx;
			overflow: auto;
			.table-box {
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin-bottom: 10rpx;
				padding: 0 10rpx;
				width: 700rpx;
				height: 80rpx;
				background: #edf5ff;
				border-radius: 4rpx;
			}
		}
	}
</style>
